package com.groupseven.backend.domain.User;



import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.Set;

/**
 * @Author 王志华
 */
public class User {
    public int Usertype;

    public int Usernum;

    public int Affiliation;

    public String Userid;

    public String Password;

    public Set<String> perms;

    public int isCurrentOnline;

    public String lastLoginDate;

    public int getIsCurrentOnline() {
        return isCurrentOnline;
    }

    public void setIsCurrentOnline(int isCurrentOnline) {
        this.isCurrentOnline = isCurrentOnline;
    }

    public String getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(String lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    @NotBlank(message = "用户名不能为空！")
    @Length(min = 1, max = 20, message = "长度要在2到20之间")
    public String Username;

    public User(int usertype, String password, String username) {
        Usertype = usertype;
        Password = password;
        Username = username;
    }

    public int getAffiliation() {
        return Affiliation;
    }

    public void setAffiliation(int affiliation) {
        Affiliation = affiliation;
    }

    public User(String userid, String password, String username) {
        Userid = userid;
        Password = password;
        Username = username;
    }

    public User(int usertype, int usernum, String userid, String password, Set<String> perms, String username) {
        Usertype = usertype;
        Usernum = usernum;
        Userid = userid;
        Password = password;
        this.perms = perms;
        Username = username;
    }

    public String getUsername() {
        return Username;
    }

    public void setUsername(String username) {
        Username = username;
    }

    public Set<String> getPerms() {
        return perms;
    }

    public void setPerms(Set<String> perms) {
        this.perms = perms;
    }

    public int getUsertype() {
        return Usertype;
    }

    public void setUsertype(int usertype) {
        Usertype = usertype;
    }

    public String getUserid() {
        return Userid;
    }

    public void setUserid(String userid) {
        Userid = userid;
    }

    public String getPassword() {
        return Password;
    }

    public void setPassword(String password) {
        Password = password;
    }

    public int getUsernum() {
        return Usernum;
    }

    public void setUsernum(int usernum) {
        Usernum = usernum;
    }

    public User(int usernum, String userid, String password,int usertype) {
        Usernum = usernum;
        Userid = userid;
        Password = password;
        Usertype = usertype;
    }

    public User(String password, String username) {
        Password = password;
        Username = username;
    }

    public User() {
        Usernum = 0;
        Userid = null;
        Password = null;
        Usertype = 0;
    }
    public User(String userid){
        this.Userid=userid;
    }
}
